﻿@using System.Data
@using ZoomLa.BLL
@using ZoomLa.Common
@using ZoomLa.BLL.Helper
@model ZoomLa.SQLDAL.SQL.PageSetting
@functions{ 
    public string ShowClientType(DataRow dr)
    {
        switch (DataConverter.CLng(dr["ClientType"]))
        {
            case 0:
                return "企业";
            case 1:
                return "个人";
            default:
                return DataConverter.CStr(dr["ClientType"]);
        }
    }
    public string ShowClientLevel(DataRow dr)
    {
        string level = DataConverter.CStr(dr["ClientLevel"]);
        switch (level)
        {
            case "A":
                return "重点客户";
            case "B":
                return "普通客户";
            case "C":
                return "非优先客户";
            default:
                return level;
        }
    }
}
@{ 
    Model.cols = 9;
}
<table class="table table-striped table-bordered" id="EGV">
    <tr>
        <td class="td_xs excel_no"></td>
        <td class="td_s">ID</td>
        <td>客户名称</td>
        <td class="td_m">客户类型</td>
        <td class="td_m">客户级别</td>
        <td class="td_m">省份</td>
        <td class="td_l">时间</td>
        <td class="td_l excel_no">操作</td>
    </tr>
    @foreach (DataRow dr in Model.dt.Rows)
            {
        <tr>
            <td class="excel_no"><input type="checkbox" name="idchk" value="@dr["ID"]" /></td>
            <td>@dr["ID"]</td>
            <td>@dr["ClientName"]</td>
            <td>@ShowClientType(dr)</td>
            <td>@ShowClientLevel(dr)</td>
            <td>@dr["Province"]</td>
            <td>@(DateHelper.ToDate(dr["CDate"]))</td>
            <td class="excel_no">
                <a href="ClientAdd?ID=@dr["ID"]" class="option_style"><i class="fa fa-user-circle-o"></i>详情</a>
                <a href="Contact?Cid=@dr["ID"]" class="option_style"><i class="fa fa-users"></i>联系人</a>
                <a href="javascript:;" class="option_style" onclick="mvcpage.del({ ids: '@dr["ID"]', url: 'client_del', confirm: '确定要删除吗' });"><i class="fa fa-trash-o"></i>删除</a>
            </td>
        </tr>
    }
    @Html.Partial("_page", Model)
</table>
